{extend name='template/base'}{/extend}
{block name='style'}{/block}
{block name='script'}{/block}
{block name='content'}
<!-- Content Wrapper. Contains page content -->
<div class="wrapper">
    <section class="content-header">
        <h5>{$data.name} 详细信息</h5>
    </section>

    <!-- Main content -->
    <section class="content">
        <form class="form-horizontal" id="form" action="{:url('Account/update')}">

            <div class=" nav-tabs-custom">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#tab_1" data-toggle="tab">基本信息</a></li>
                    <li><a href="#tab_2" data-toggle="tab">交易信息</a></li>
                    <li class="dropdown open pull-right">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="true">
                            <i class="fa fa-gear"></i>
                        </a>
                        <ul class="dropdown-menu text-center">
                            <li role="presentation"><a role="menuitem" tabindex="-1" class="ks-ajax-submit" data-action="{:url('Account/update')}"><i class="fa fa-save"></i> 保存</a></li>
                            <li role="presentation"><a role="menuitem" tabindex="-1" class="ks-ajax-reset"><i class="fa fa-undo"></i> 重置</a></li>
                        </ul>
                    </li>
                </ul>
                <div class="tab-content">
                    <!-- 基本信息 -->
                    <div class="tab-pane active" id="tab_1">
                        <div class="box-body">
                            <input type="hidden" class="form-control" name="id" value="{$data.id}" >
                            <div class="form-group">
                                <label class="col-sm-2 control-label">昵称</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" name="nick" value="{$data.nick}" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">真实姓名</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" name="name" value="{$data.name}" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">手机</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" name="mobile" value="{$data.mobile}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">Email</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" name="email" value="{$data.email}"  >
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">微信号</label>
                                <div class="col-sm-4" >
                                    <input type="text" class="form-control" name="wechat" value="{$data.wechat}" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">性别</label>
                                <div class="col-sm-8" style="padding-top: 7px;">
                                    {if $data.sex eq 0}女{else}男{/if}
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">微信昵称</label>
                                <div class="col-sm-4" style="padding-top: 7px;">
                                    {$data.nickname}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">Openid</label>
                                <div class="col-sm-8" style="padding-top: 7px;">
                                    {$data.openid}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">Unionid</label>
                                <div class="col-sm-8" style="padding-top: 7px;">
                                    {$data.unionid}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">国家</label>
                                <div class="col-sm-4" style="padding-top: 7px;">
                                    {$data.country}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">省份</label>
                                <div class="col-sm-4" style="padding-top: 7px;">
                                    {$data.province}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">城市</label>
                                <div class="col-sm-4" style="padding-top: 7px;">
                                    {$data.city}
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">状态</label>
                                <div class="col-sm-4" style="padding-top: 7px;">
                                    <span class="mr20" style="padding-right: 20px">
                                <input type="radio" class="minimal" name="flag_lock" value="0" {if $data.flag_lock eq 0}checked{/if}> 使用
                            </span>
                                    <span class="mr20">
                                <input type="radio" class="minimal" name="flag_lock" value="1" {if $data.flag_lock eq 1}checked{/if}> 锁定
                            </span>
                                </div>
                            </div>
                        </div>

                    </div>

                    <!-- 账户信息 -->
                    <div class="tab-pane" id="tab_2">
                        <div class="box-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">余额</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control" name="money" value="{$data.money}"  >
                                </div>
                            </div>
                        </div>

                    </div>

                    <div class="tab-footer">
                        <button type="submit" class="btn btn-primary" style="margin-left: 200px;margin-bottom: 50px">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                    </div>
                </div>

            </div>
        </form>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
{/block}
{block name='script_extra'}

<script>
    $("#form").Validform({
        tiptype:2,
        showAllError:true,
        ajaxPost: true,
        callback: function (res) {
            console.log(1111);
            if (res.success == true){

                layer.msg(res.message, {time: 1000},function () {
                    layer_close();
                    parent.$('#table').bootstrapTable('refresh');
                });
            }else{
                layer.alert(res.message);
            }
        }
    });
</script>
{/block}